<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'register.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="css/login.css">
	</head>
	<script type="text/javascript">
		function my(){
			var msg = "${MSG}";
			if(msg!=""){
				alert(msg);
			}
		}
		function  checkLogin(){
			var uname = document.getElementByName("uname")[0].value;
			var upn = document.getElementByName("phonenumber")[0].value;
			var upwd = document.getElementsByName("upassword")[0].value;
			if(uname=="" || uname==null){
				alert("用户名不能为空");
				return false;
			}else if(upn.length!=11){
				alert("手机号码位数错误");
				return false;
			}else if(upwd.length<1 || upwd.length>6){
				alert("密码应在1-6位");
				return false;}
			else if
				(upwd=="" || upwd==null){
				alert("密码不能为空");
				return false;
			}
			return true;
		}
		
		
	</script>

<body onload="my()">
<header>
	<div class="logo"></div>
</header>
<main>
	<div class="kuang">
        <div class="p">
        	<p class="sm"><a href="user/preLogin.do">账户登录</a></p>
			<p class="zh"><a href="user/preRegister.do">账户注册</a></p>
		</div>
		<form action="user/regist.do" method="post" enctype="multipart/form-data" onsubmit="checkLogin()">
			<input type="file" name="pictureFile"  />
			<input name="uname" type="text" placeholder="用户名" class="yhm" >
	    	<input name="phonenumber" type="text" placeholder="手机号码" class="number" >
	   	 	<input name="upassword" type="password" placeholder="密码" class="mm" >
     
	      	<input class="r1" type="radio" name="type" value="0" />买家
	      	<input class="r2" type="radio" name="type" value="1" />卖家
      		<input type="submit" class="button" value="注册"/>
		</form> 
		
	</div>
</main>
	<div>
		<iframe src="footer.html" width="100%"; height="450px" frameborder="0" scrolling="no" name="headFrame" style="position: absolute;z-index:9999;"></iframe>
	</div>
</body>
</html>
